package com.wujilin.okra.loader;

import com.wujilin.okra.database.Sql;

import android.content.Context;
import android.database.Cursor;

/**
 * The cursor loader for the complicated SELECT statements.
 * 
 * @author Belin Wu
 *
 */
public class QueryCursorLoader extends CursorLoader {
	private String sql;
	private String[] args;
	
	public QueryCursorLoader(Context context, String sql, String... args) {
		super(context);
		this.sql = sql;
		this.args = args;
	}

	@Override
	public Cursor loadCursor() {
		return Sql.query(sql, args);
	}
}
